<template>
	<view>
		<view class="container container1" v-if="roles === 2">
			<view class="top">
				<view class="topPhone">
					<view class="myname">
						我的账号
					</view>
					<view class="myphone">
						{{myphone}}
					</view>
				</view>
				<view class="myvip">
					<view class="mytime">会员时长: </view>
					<view class="mytime wsize">{{myviptime}}</view>
					<text class="mytime"> 到期</text>
				</view>
			</view>
			<view class="my_record">
				<view class="record record2">
					<text>取液记录</text>
					<text class="examine examine_btn" @click="record">查看 ></text>
				</view>
				<view class="record record2">
					<text>我的发票</text>
					<text class="examine examine_btn" @click="invoice">查看 ></text>
				</view>
				<view class="record record2">
					<text>注册地址</text>
					<text class="examine">{{ city }}</text>
				</view>
				<view class="record record2">
					<text>店铺名称</text>
					<text class="examine">{{ nickname }}</text>
				</view>
			</view>
			<view class="btn_quit" @click="quit">退出登录</view>
		</view>

		<!-- 服务合伙人 / 门店合伙人 -->
		<view class="container container2" v-if="roles === 6 || roles === 7">
			<view class="personal_top">
				<view class="a_top">
					<view class="a_top1">
						<view class="txt1">
							本月累计收入(元)
						</view>
						<view class="txt2">
							{{income}}
						</view>
					</view>
				</view>
			</view>
			<view class="personal_table">
				<view class="tab1" @click="billDetails">
					<image src="/static/image/users/personal_store/12.png" mode=""></image>
					<view class="tab1_txt">
						对账
					</view>
				</view>
				<view class="tab1 tableft" @click="uploading">
					<image src="/static/image/users/personal_store/13.png" mode=""></image>
					<view class="tab1_txt">
						上传发票
					</view>
				</view>
				<view class="tab1 tableft" @click="confirmReceipt">
					<image src="/static/image/users/personal_store/14.png" mode=""></image>
					<view class="tab1_txt">
						确认收款
					</view>
				</view>
				<view class="tab1 tableft" v-if="roles === 7" @click="receiveComments">
					<image src="/static/image/users/personal_store/17.png" mode=""></image>
					<view class="tab1_txt">
						收到的评价
					</view>
				</view>
				<view class="tab1 tableft" @click="deviceWx" v-if="roles === 6">
					<image src="/static/image/users/personal_store/15.png" mode=""></image>
					<view class="tab1_txt">
						设备报修
					</view>
				</view>
			</view>

			<view class="myrow" v-if="roles === 7">
				<view class="myname mycommon">
					<view class="mycommons">
						我的账号
						<view class="mynames">
							weibake2023
						</view>
					</view>
				</view>
				<view class="mypwd mycommon" @click="changePwd">
					<view class="mycommons">
						修改密码
						<view class="mybtn">
							点击修改
						</view>
					</view>
				</view>
			</view>

			<view class="myrows" v-else>
				<view class="myname mycommon" @click="serviceEvaluation">
					<view class="mycommons">
						服务评价
						<view class="mynames">
							立即评价
						</view>
					</view>
				</view>
				<view class="myname mycommon">
					<view class="mycommons">
						我的账号
						<view class="mynames">
							{{account}}
						</view>
					</view>
				</view>
				<view class="mypwd mycommon" @click="changePwd">
					<view class="mycommons">
						修改密码
						<view class="mybtn">
							点击修改
						</view>
					</view>
				</view>
			</view>

			<view class="exit">
				<button @click="handleExit">退出登录</button>
			</view>
		</view>

		<!-- 城市合伙人 /-->
		<view class="container container3" v-if="roles === 4 || roles === 5 ">
			<view class="city_record">
				<view class="city_name">
					<view class="myname">
						我的账号
					</view>
					<view class="cityname">
						weibake2023
					</view>
				</view>
				<view class="xian"></view>
				<view class="city_pwd">
					<view class="changepawd">
						修改密码
					</view>
					<view class="changepwds" @click="changePwd">
						点击修改
					</view>
				</view>
			</view>
			<button class="citybtn" @click="handleExit">退出登录</button>
		</view>

		<view class="container container3" v-if="roles === 3">
			<view class="city_record">
				<view class="city_name">
					<view class="myname">
						我的账号
					</view>
					<view class="cityname">
						weibake2023
					</view>
				</view>
				<view class="xian"></view>
				<view class="city_pwd">
					<view class="changepawd">
						修改密码
					</view>
					<view class="changepwds" @click="changePwd">
						点击修改
					</view>
				</view>
			</view>
			<button class="citybtn" @click="handleExit">退出登录</button>
		</view>
	</view>
</template>


<script>
	import {
		personal_users,
	} from '@/common/mixins/personal/personal_users.js';
	import {
		personal_store,
	} from '@/common/mixins/personal/personal_store.js';

	import {
		duizhang
	} from "@/common/mixins/duizhang/index.js"

	import {
		exit
	} from "@/common/mixins/personal/exit.js"
	export default {
		mixins: [personal_users, personal_store, duizhang, exit],

		data() {
			return {
				roles: wx.getStorageSync('roles')
			}
		},
		methods: {
			// 确认收款
			confirmReceipt() {
				uni.navigateTo({
					url: "/pages/business/collection/index"
				})
			},

			// 设备报修
			deviceWx() {
				uni.navigateTo({
					url: "/pages/store/deviceRepairs/index"
				})
			},

			// 服务评价
			serviceEvaluation() {
				uni.navigateTo({
					url: "/pages/store/servevalue/index"
				})
			},

			// 修改密码
			changePwd() {
				uni.navigateTo({
					url: '/pages/changepwd/index'
				})
			},

			// 收到的评价
			receiveComments() {
				uni.navigateTo({
					url: '/pages/server/evaluatelist/index'
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	@import '@/common/sass/all/all.scss';
	@import '@/common/sass/personal/personal.scss';
	@import '@/common/sass/personal/personal_serve.scss';
	@import '@/common/sass/personal/personal_store.scss';
	@import '@/common/sass/personal/personal_city.scss';
</style>